package com.lzw.service.impl.maintenance;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.lzw.mapper.maintenance.MRM;
import com.lzw.pojo.RepairRequest;
import com.lzw.service.maintenance.MRS;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

@Service
public class MSRI implements MRS {

    @Autowired
    private MRM mrm;

    @Override
    public List<RepairRequest> list(Integer pageNum, Integer pageSize, LocalDate requestDate) {
        PageHelper.startPage(pageNum,pageSize);
        List<RepairRequest> list = mrm.list(requestDate);
        Page<RepairRequest> repairRequests = (Page<RepairRequest>) list;
        return repairRequests;
    }

    @Override
    public void update(RepairRequest repairRequest) {
        mrm.update(repairRequest);
    }
}
